package day01;

import java.util.Arrays;
import java.util.Scanner;

public class L0101 {
    public static void main (String[] args) {
        Scanner scanner =new Scanner (System.in);
        int n;
        n=scanner.nextInt ();
        int[] a=new int[n*3];
        for (int i = 0; i < n*3; i++) {
            a[i]= scanner.nextInt ();
        }
        Arrays.sort(a);
        int total=0;
        for (int i = n; i <2*n ; i++) {
            total+=a[i];
        }

        System.out.println (total);

    }

}
